This page has been superceded by a wiki version of this example: LocalesExample
/*
locales1.d
Author: Justin C Calvarese
Date: October 6, 2003
License: Public Domain
Demonstrates using version() to handle different locales.
Compile for the English locale:
dmd locales.d -version=English
Compile for the German locale:
dmd locales.d -version=Deutsch
*/
version(English)
{
const char[] salutation = "Hi";
const char[] negative = "No";
}
version(Espanol)
{
const char[] salutation = "Hola";
const char[] negative = "No";
}
version(Francais)
{
const char[] salutation = "Bonjour";
const char[] negative = "Non";
}
version(Deutsch)
{
const char[] salutation = "Hallo";
const char[] negative = "Nein";
}
int main()
{
printf("%.*s\n", salutation);
return 0;
}